package com.guochenglang.www.dao;

import com.guochenglang.www.pojo.Reply;

import java.sql.SQLException;
import java.util.ArrayList;

/**
 * @author GuoChenglang
 */
public interface ReplyDao {
    /**
     * 获得回复列表
     *
     * @param reply 回复id
     * @return 回复列表
     * @throws SQLException           sql异常
     * @throws InterruptedException   断点异常
     * @throws IllegalAccessException 非法访问异常
     * @throws InstantiationException 实现异常
     */
    ArrayList<Reply> replySelect(Reply reply) throws SQLException, InterruptedException, IllegalAccessException, InstantiationException;

    /**
     * 添加回复
     *
     * @param reply 回复消息
     * @return 添加的主键
     * @throws SQLException           sql异常
     * @throws InterruptedException   断点异常
     * @throws IllegalAccessException 非法访问异常
     */
    int insertReply(Reply reply) throws SQLException, InterruptedException, IllegalAccessException;

    /**
     * 删除回复
     *
     * @param reply 删除条件
     * @return 删除行数
     * @throws SQLException           sql异常
     * @throws InterruptedException   断点异常
     * @throws IllegalAccessException 非法访问异常
     */
    int deleteReply(Reply reply) throws SQLException, InterruptedException, IllegalAccessException;
}
